\documentclass{article}

	\usepackage[linesnumbered,ruled]{algorithm2e}
	%\usepackage[linesnumbered,boxed]{algorithm2e}
%\usepackage{algorithmic} %format of the algorithm
\usepackage{multirow} %multirow for format of table
\usepackage{amsmath}
\usepackage{xcolor}


\usepackage{graphics}
\usepackage{graphicx}
\usepackage{epsfig}

\begin{document}
\begin{algorithm}
	\caption{identifyRowContext}
	\KwIn{$r_i$ , $Backgrd(T_i)$=${T_1,T_2,\ldots,T_n}$ and similarity threshold $\theta_r$}
	\KwOut{$con(r_i)$}
	$con(r_i)= \Phi$\;
	\For{$j=1;j \le n;j \ne i$}
	{
		float $maxSim=0$\;
		$r^{maxSim}=null$\;
		\While{not end of $T_j$}
		{
			compute Jaro($r_i,r_m$)($r_m \in T_j$)\;
			\If{$(Jaro(r_i,r_m) \ge \theta _r) \wedge ((Jaro(r_i,r_m) \ge r^{maxSim}) $}
			{
				replace $r^maxSim$ with $r_m$\;
			}   
		}
		$con(r_i)=con(r_i) \cup {r^{maxSim}}$\;
	}
	return $con(r_i)$\;
\end{algorithm}

\begin{algorithm} [!ht]
	\caption{identifyRowContext} 
	\KwIn{$r_i$, $Backgrd(T_i)$=${T_1,T_2,\ldots ,T_n}$ and similarity threshold $\theta_r$} 
	\KwOut{$con(r_i)$} 
	$con(r_i)= \Phi$\; 
	\For{$j=1;j \le n;j \ne i$} 
	{ 
		float $maxSim=0$\; 
		$r^{maxSim}=null$\; 
		\While{not end of $T_j$} 
		{ 
			compute Jaro($r_i,r_m$)($r_m\in T_j$)\; 
			\If{$(Jaro(r_i,r_m) \ge \theta_r)\wedge (Jaro(r_i,r_m)\ge r^{maxSim})$} 
			{ 
				replace $r^{maxSim}$ with $r_m$\; 
			} 
		} 
		$con(r_i)=con(r_i)\cup {r^{maxSim}}$\; 
	} 
	return $con(r_i)$\; 
\end{algorithm}
			
\end{document}